package co.com.sewebpoint.test.capa.spring;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import co.com.sewebpoint.dao.SolicitudDAO;
import co.com.sewebpoint.dao.imp.SolicitudDAOIMP;
import co.com.sewebpoint.exception.DaoExceptionSE;
import co.com.sewebpoint.model.Solicitud;


@RunWith(SpringJUnit4ClassRunner.class) 
@ContextConfiguration(locations = "classpath:configuracion.xml")
@Transactional

public class SolicitudTestSpring {

	@Autowired
	SolicitudDAO solicitudDAO;
	
	
	@Test
	public void testGetAllItems() {

		
		List<Solicitud> items;
		
		try {
			
			System.out.println(solicitudDAO);
			items = solicitudDAO.getAllItems();
		
			
		
		
		
		System.out.println("Existen "+ items.size());
		
		for(Solicitud e:items){
			
			
			System.out.println("ID: " +e.getId());
			System.out.println("nombre: " +e.getNombre());
			System.out.println("apellido: " +e.getApellido());
			System.out.println("email" +e.getEmail());
			System.out.println("telefono: " +e.getTelefono());
			System.out.println("celular: " +e.getCelular());
			System.out.println("sucursal: " +e.getSucursal());
			System.out.println("producto: " +e.getProducto());
			System.out.println("tipo de Solicitud: " +e.getTipoSolicitud());
			System.out.println("descripcion Solicitud: " +e.getDesSolicitud());
		}
		
		assertTrue(true);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	

}
